package com.probiz.estore.common.model.content.base;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.core.model.BaseObject;

/**
 * NewsletterGroupNewsletter Base Java Bean, base class for the model, mapped directly to database table
 * 
 * Avoid changing this file if not necessary, will be overwritten. 
 *
 */
public class NewsletterGroupNewsletterTbl extends BaseObject implements Serializable {

	protected NewsletterGroupNewsletterPK newsletterGroupNewsletterPK = new NewsletterGroupNewsletterPK();

	/**
	 * Default Empty Constructor for class NewsletterGroupNewsletter
	 */
	public NewsletterGroupNewsletterTbl () {
		super();
	}
	
	
  /**
	* @return newsletterGroupNewsletterPK
	*/
	public NewsletterGroupNewsletterPK getNewsletterGroupNewsletterPK() {
		return this.newsletterGroupNewsletterPK;
	}
	
  /**
	* @set newsletterGroupNewsletterPK
	*/
	public void setNewsletterGroupNewsletterPK(NewsletterGroupNewsletterPK aPrimaryKey) {
		this.newsletterGroupNewsletterPK = aPrimaryKey;
	}
    

	

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof NewsletterGroupNewsletterTbl)) {
			return false;
		}
		NewsletterGroupNewsletterTbl rhs = (NewsletterGroupNewsletterTbl) object;
		return new EqualsBuilder()
				.append(this.newsletterGroupNewsletterPK.newsletter.getNewsletterId(), rhs.newsletterGroupNewsletterPK.newsletter.getNewsletterId())
				.append(this.newsletterGroupNewsletterPK.newsletterGroup.getNewsletterGroupId(), rhs.newsletterGroupNewsletterPK.newsletterGroup.getNewsletterGroupId())
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973)
				.append(this.newsletterGroupNewsletterPK.newsletter.getNewsletterId()) 
				.append(this.newsletterGroupNewsletterPK.newsletterGroup.getNewsletterGroupId()) 
				.toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("newsletterId", this.newsletterGroupNewsletterPK.newsletter.getNewsletterId()) 
				.append("newsletterGroupId", this.newsletterGroupNewsletterPK.newsletterGroup.getNewsletterGroupId()) 
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "newsletterId";
	}
	
}
